
package com.ywjg.serviceimp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ywjg.dao.CheckReportDao;
import com.ywjg.model.CheckReport;
import com.ywjg.service.ICheckReportService;
import com.ywjg.utils.Utils;
@Service
public class CheckReportService implements ICheckReportService {
    @Resource
	CheckReportDao checkReportDao;

	/* (non-Javadoc)
	 * @see com.ywjg.serviceimp.ICheckReportService#getCheckReportInf(java.lang.Integer)
	 */
	public CheckReport getCheckReportInf(Integer user_id) {
		// TODO Auto-generated method stub
		return checkReportDao.findByappUserId(user_id);
	}
	
	/* (non-Javadoc)
	 * @see com.ywjg.serviceimp.ICheckReportService#addCheckReportInf(com.ywjg.model.CheckReport)
	 */
	public CheckReport addCheckReportInf(CheckReport c) {
		// TODO Auto-generated method stub
		return checkReportDao.save(c);
	}

	/* (non-Javadoc)
	 * @see com.ywjg.serviceimp.ICheckReportService#upDateReportInf(com.ywjg.model.CheckReport)
	 */
	public CheckReport upDateReportInf(CheckReport c) {
		CheckReport findOne = checkReportDao.findOne(c.getId());
		Utils.copyPropertiesIgnoreNull(c, findOne);
		return checkReportDao.save(findOne);
	}
	
	/* (non-Javadoc)
	 * @see com.ywjg.serviceimp.ICheckReportService#getAllReportInf()
	 */
	public List<CheckReport> getAllReportInf() {
		List<CheckReport> findAll = checkReportDao.findAll();
		return findAll;
	}

	
}
